<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			span{display: inline-block;}
			input,span{height: 40px;box-sizing: border-box;}
			#start{background-color: #f60;color: #fff;padding: 0 10px;cursor: pointer;}
		</style>
	</head>
	<body>
		<input type="number" name="" id="number-one" >
		+
		<input type="number" name="" id="number-two">
		=
		<span id="result"></span>
		<span id="start">开始计算</span>
		<div id="result-box"></div>
		<script type="text/javascript">
			var numberOne 	= document.getElementById('number-one');
			var numberTwo 	= document.getElementById('number-two');
			var result 		= document.getElementById('result');
			var start 		= document.getElementById('start');
			var resultBox 	= document.getElementById('result-box');
			
			start.onclick 	= function(){ // 第一步
				result.innerText = numberOne.valueAsNumber + numberTwo.valueAsNumber;
				var date 		 = new Date();
				var time 		 = date.getTime();
				var express = numberOne.valueAsNumber + '+' + numberTwo.valueAsNumber + '=' + (numberOne.valueAsNumber + numberTwo.valueAsNumber)
				localStorage[time] = express;
				resultBox.innerHTML += localStorage[time] + '<br />';
			}
			
			console.dir(localStorage);
			for(var i in localStorage){
				resultBox.innerHTML += localStorage[i] + '<br />';
			}
		</script>
	</body>
</html>